home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 January / EnterCD 01_2004.iso / Multimedia / Advanced Effect Maker Freeware Edition 1.0 / aemf10.exe / {app} / templates / brokenglassimage.swf / scripts / frame_6 / DoAction.as
Encoding:
Text File  |  2002-10-12  |  1.4 KB  |  72 lines

  1. myp--;
  2. if(myp < 0)
  3. {
  4.    ii++;
  5.    if(ii >= maxitems)
  6.    {
  7.       ii = 0;
  8.    }
  9.    i = 0;
  10.    while(i < ns)
  11.    {
  12.       dx[i] = int(Math.random() * (xto - xfrom) + xfrom);
  13.       if(0.5 < Math.random())
  14.       {
  15.          dx[i] = - dx[i];
  16.       }
  17.       dy[i] = int(Math.random() * (yto - yfrom) + yfrom);
  18.       if(0.5 < Math.random())
  19.       {
  20.          dy[i] = - dy[i];
  21.       }
  22.       dr[i] = int(Math.random() * (sto - sfrom) + sfrom);
  23.       if(0.5 < Math.random())
  24.       {
  25.          dr[i] = - dr[i];
  26.       }
  27.       i++;
  28.    }
  29.    myp = tpause;
  30. }
  31. aval = myp;
  32. if(tpause / 4 >= aval)
  33. {
  34.    aval = int(Math.abs(aval) * 400 / tpause);
  35. }
  36. else if(aval >= tpause * 3 / 4)
  37. {
  38.    aval = int(Math.abs(tpause - aval) * 400 / tpause);
  39. }
  40. else
  41. {
  42.    aval = 100;
  43. }
  44. i = 0;
  45. while(i < ns)
  46. {
  47.    k = 0;
  48.    while(k < maxitems)
  49.    {
  50.       setProperty(i add ".mim.image" add k, _visible, false);
  51.       k++;
  52.    }
  53.    setProperty(i add ".mim.image" add ii, _visible, true);
  54.    setProperty(i, _alpha, aval);
  55.    if(tpause / 2 >= myp)
  56.    {
  57.       setProperty(i, _X, getProperty(i, _X) + dx[i]);
  58.       setProperty(i, _Y, getProperty(i, _Y) + dy[i]);
  59.       if(0 < rc)
  60.       {
  61.          setProperty(i, _rotation, getProperty(i, _rotation) + dr[i]);
  62.       }
  63.    }
  64.    else
  65.    {
  66.       setProperty(i, _X, 0);
  67.       setProperty(i, _Y, 0);
  68.       setProperty(i, _rotation, 0);
  69.    }
  70.    i++;
  71. }
  72.